/**
 * Copyright (c) 2017-2017 All Rights Reserved.
 */
package com.zbest.zpay.paycore.biz.action.pay;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zbest.zpay.paycore.dal.dao.PayInfoDAO;
import com.zbest.zpay.paycore.dal.model.PayInfoDO;
import com.zbest.zpay.paycore.dal.model.PaySubInfoDO;
import com.zbest.zpay.paycore.integration.trade.TradeClient;
import com.zbest.zpay.paycore.model.PayInfoStatus;
import com.zbest.zpay.service.paycore.model.PaycoreKeyEnum;
import com.zbest.zpay.shared.process.BaseAction;
import com.zbest.zpay.shared.process.ProcessResult;

/**
 * 
 *
 * @author Administrator
 * @version $Id: NotifyTradeAction.java, v 0.1 2017-4-16 下午2:03:04 Administrator Exp $
 */
@Service("notifyTradeAction")
public class NotifyTradeAction extends BaseAction {

    @Resource
    private PayInfoDAO  payInfoDAO;

    @Resource
    private TradeClient tradeClient;

    /** 
     * @see com.zbest.zpay.shared.process.BaseAction#perform(com.zbest.zpay.shared.process.ProcessResult)
     */
    @Override
    public void perform(ProcessResult processResponse) {

        PaySubInfoDO paySubInfoDO = getValue(PaycoreKeyEnum.PAY_SUB_INFO_DO.getCode());
        PayInfoDO payInfoDO = payInfoDAO.query(paySubInfoDO.getPayInfoId());
        if (payInfoDO.getStatus().equals(PayInfoStatus.SUCCESS.getCode())) {
            //通知tradeClient
        }

    }

}
